#!/bin/bash

if [[ "$(uname -s)" == "Linux" ]]; then
	curl -L -O "https://mirrors.bfsu.edu.cn/github-release/conda-forge/miniforge/LatestRelease/Miniforge3-$(uname)-$(uname -m).sh"
	bash Miniforge3-$(uname)-$(uname -m).sh -b
	mamba_path=$HOME/miniforge3/condabin/mamba
	$mamba_path init "$(basename "${SHELL}")"
	conda_path=$HOME/miniforge3/condabin/conda
	$conda_path config --set show_channel_urls yes
	$conda_path config --set auto_activate_base false
	$conda_path config --set custom_channels.conda-forge https://mirrors.bfsu.edu.cn/anaconda/cloud/
	$HOME/miniforge3/bin/python3 -m pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple
fi
